package cn.edu.zut.soft.student.dao;

import cn.edu.zut.soft.student.model.Course;
import cn.edu.zut.soft.student.model.Student;
import cn.edu.zut.soft.student.model.StudentExample;

import java.util.List;

import cn.edu.zut.soft.student.model.StudentSelectCourses;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

@Mapper
@Component
public interface StudentMapper {
    long countByExample(StudentExample example);

    int deleteByExample(StudentExample example);

    int deleteByPrimaryKey(String studentid);

    int insert(Student record);

    int insertSelective(Student record);

    List<Student> selectByExample(StudentExample example);

    Student selectByPrimaryKey(String studentid);

    int updateByExampleSelective(@Param("record") Student record, @Param("example") StudentExample example);

    int updateByExample(@Param("record") Student record, @Param("example") StudentExample example);

    int updateByPrimaryKeySelective(Student record);

    int updateByPrimaryKey(Student record);

    //按学生ID查询其选的课
    List<Course> querySelectCourseByStudentID(@Param("StudentID") String StudentID);

    //查询学生所选所有课程
    List<StudentSelectCourses> selectcourses();

    //修改学生密码
    int updatePassword(@Param("password") String password, @Param("studentid") String studentid);

    int selectCourse(@Param("courseid") String courseid, @Param("studentid") String studentid);

    int deleteSelectCourse(@Param("courseid") String courseid, @Param("studentid") String studentid);
}